package com.farm.decorator;

import com.farm.AgriculturalMachine;

//GPS装饰器
public class GPSDecorator extends MachineDecorator {
    public GPSDecorator(AgriculturalMachine decoratedMachine) {
        super(decoratedMachine);
    }

    @Override
    public void operate(String  machineName) {
        super.operate(machineName);
        enableGPS(machineName);
    }

    @Override
    public void displayStatus(String  machineName) {

    }

    @Override
    public String getDescription() {
        return super.getDescription() + ", 带GPS导航";
    }

    private void enableGPS(String  machineName) {
        System.out.println(machineName + "启用GPS精确定位");
    }
}
